class Solution:
    def translateNum(self, num: int) -> int:
        s = str(num)
        n = len(s)
        pre = 1
        cur = 1
        for i in range(2, n+1):
            temp = int(s[i-2]+s[i-1])
            if 9 < temp < 26:
                t = cur
                cur = pre+cur
                pre = t
            else:
                pre = cur
        return cur
